IF OBJECT_ID('dbo.csp_rptMetric_DefaultCurrentPeriod') IS NOT NULL
BEGIN
    DROP PROCEDURE dbo.csp_rptMetric_DefaultCurrentPeriod
END
GO

CREATE PROCEDURE dbo.csp_rptMetric_DefaultCurrentPeriod
(
	@PeriodType varchar(50)
)
AS

SELECT TOP 1
	PeriodStartDate
FROM
	rptMetric_Snapshots
WHERE
	PeriodType = @PeriodType
ORDER BY
	PeriodStartDate DESC
GO
